﻿namespace ShadowCode.Injection.Base;

public abstract class UnitBase(TransformData data)
{

    /// <summary>
    /// 返回被特性标记的类型定义
    /// </summary>
    protected INamedTypeSymbol GetAttributeType(SyntaxNode syntax) =>
        data.GetDeclaredSymbol(syntax) as INamedTypeSymbol
        ?? throw new Exception($"找不到标记特性的类型定义{syntax}");
}